package test.nine;

import java.util.Arrays;

public abstract class StringProcesser implements Processer {
	public String name() {
		return getClass().getSimpleName();
	}

	public abstract String process(Object input);

	public static String s = "If she weights the same as a duck,she's made of wood.";

	public static void main(String[] args) {
		Apply.process(new Upcase(), s);
		Apply.process(new Downcase(), s);
		Apply.process(new Spiltter(), s);
	}

}

class Upcase extends StringProcesser {
	@Override
	public String process(Object input) {
		return ((String) input).toUpperCase();
	}
}
class Downcase extends StringProcesser {
	@Override
	public String process(Object input) {
		return ((String) input).toLowerCase();
	}
}
class Spiltter extends StringProcesser {
	@Override
	public String process(Object input) {
		return Arrays.toString(((String)input).split(" "));
	}
}